from gen import generate_test_data
from alg import Solution


def run_test():
    """生成测试数据并验证算法正确性"""
    # 生成测试数据
    heights = generate_test_data()
    print(f"测试用例: {heights}")

    # 计算结果
    solution = Solution()
    result = solution.trap(heights)

    # 打印结果
    print(f"计算结果: 可以接住 {result} 单位的雨水")

if __name__ == "__main__":
    run_test()